package com.qf.controller;

import com.qf.util.AliyunOSSUtil;
import com.qf.util.R;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * --- 业精于勤,荒于嬉 ---
 *
 * @author Song
 * @date 2024/7/27
 * @desc First
 */
@RestController
public class UploadController {

    /**
     * 演示上传文件到OSS
     */
    @PostMapping("/upload")
    public R upload(MultipartFile file){
        String filePath = AliyunOSSUtil.upLoad(file);
        return R.ok(filePath);
    }

}
